﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

namespace BZZ.Web
{
    public class SetLog
    {
        /// <summary>
        /// 写入操作日志
        /// </summary>
        /// <param name="logType">日子类型</param>
        /// <param name="adminID">操作人ID</param>
        /// <param name="operIP">操作IP</param>
        /// <param name="result">操作结果：成功Y，失败N</param>
        /// <param name="ext">操作详细</param>
        /// <param return>返回结果，0表示失败，其他>0的数表示成功</param>
        public static int SetAdminLog(string logType, int adminID, string operIP, string result, string ext)
        {
            int res = 0;
            BZZ.DAL.adminlog dal = new BZZ.DAL.adminlog();
            BZZ.Model.adminlog model = new BZZ.Model.adminlog();
            model.adminid = adminID;
            model.ext = ext;
            model.logtype = logType;
            model.operateIP = operIP;
            model.operateResult = result;
            model.operateTime = DateTime.Now;

            res = dal.Add(model);
            return res;
        }

    }
}
